import request from '@/util/request.ts'
import type {
  loginFormData,
  loginResponseData
} from './type'

enum API {
  ADD_video_URL = '/video',
  VIDEO_LIST_URL = '/video/list',
  USER_VIDEO_LIST_URL = '/video/list/id',
  VIDEO_REVIEW_LIST_URL = '/video/list/review',
  ADD_REVIEW_URL = '/video/review',
  ADD_USER_REVIEW_VIDEO = '/video/addUserViewVideo',
  OPERATE_VIDEO_URL = '/video/operate',
  ADD_USER_LIKE_VIDEO_URL = '/video/addUserLikeVideo',
  USER_PAGE_VIDEO_LIST_URL = '/video/user/videoList',
}


// 发布视频
export const reqAddVideo = (data) =>
  request.post(API.ADD_video_URL, data)



//获取视频列表 0 - 推荐 1-关注 2-朋友 3-博主或个人
export const reqVideoList = (data) =>
  request.post(API.VIDEO_LIST_URL, data)

//获取博主视频列表
export const reqUserVideoList = (data, config = {}) =>
    request.post(API.USER_VIDEO_LIST_URL, data, config);

//获取评论列表
export const reqReviewList = (data) =>
    request.post(API.VIDEO_REVIEW_LIST_URL, data);

//发布评论
export const reqAddReview = (data) =>
    request.post(API.ADD_REVIEW_URL, data);


//获取评论
export const reqAddUserViewVideo = (data) =>
    request.post(API.ADD_USER_REVIEW_VIDEO, data);

//点赞1、收藏2、分享3 关注4
export const reqAddUserLikeVideo = (data) =>
    request.post(API.ADD_USER_LIKE_VIDEO_URL, data);

//点赞1、收藏2、分享3 关注4
export const reqOperateVideo = (data) =>
    request.post(API.OPERATE_VIDEO_URL, data);

//取消 点赞1、收藏2、分享3 关注4
export const reqNotOperateVideo = (data) =>
    request.post(API.OPERATE_VIDEO_URL+ '/not', data);


//获取用户下视频列表 1 - 作品 2 - 喜欢 3 - 收藏 4 - 观看历史
export const reqUserVideo = (data) =>
    request.post(API.USER_PAGE_VIDEO_LIST_URL , data);


